<template>
	<view>
		<!-- 二维码预览 S-->
		<uni-popup type="center" ref="previewCode" :maskClick="false">
			<view class="preview_code-wrap">
				<view class="code"><image :src="url" mode=""></image></view>
				<uni-icons @click="hide" class="close-icon" type="close" size="40" color="#fff"></uni-icons>
			</view>
		</uni-popup>
		<!-- 二维码预览 E-->
	</view>
</template>

<script>
	export default {
		props: {
			url: {
				type: String
			}
		},
		data() {
			return {
				
			};
		},
		methods: {
			show() {
				this.$refs.previewCode.open()
			},
			hide() {
				this.$emit('hide')
				this.$refs.previewCode.close()
			},
		}
	}
</script>

<style lang="scss" scoped>
.preview_code-wrap {
	height: 520rpx;
	width: 520rpx;
	padding: 28rpx;
	box-sizing: border-box;
	background-color: #fff;
	border-radius: 20rpx;
	position: relative;
	.code {
		background-color: pink;
		width: 100%;
		height: 100%;
	}
	.close-icon {
		position: absolute;
		left: 50%;
		transform: translateX(-50%);
		bottom: -120rpx;
	}
}
</style>
